package com.example.utils.weixin;

import lombok.extern.slf4j.Slf4j;
//import org.apache.log4j.Logger;

import java.io.InputStream;
import java.util.Properties;

@Slf4j
public class Configure {

	// 商户的api秘钥
	public static String key = null;
	// 小程序ID
	public static String appId = null;
	// 商户号
	public static String mch_id = null;
	// 小程序的secret
	public static String secret = null;
	//支付回调
	public static String weixin_pay_callback_url = null;

	//支付回调
	public static String weixin_tec_pay_callback_url = null;

	//退款回调
	public static String weixin_refund_callback_url = null;

	/** 图片视频等的前缀 */
	public static String prefix = null;

	/** webStocket的请求前缀 */
	public static String webStocketUrl=null;

	/**服务器IP*/
	public static String IP = null;

	/**服务器端口*/
	public static String port = null;



	//private static final Logger log = Logger.getLogger(Configure.class);

	static {
		InputStream in = null;
		try {
			Properties pps = new Properties();
			in = Configure.class.getClassLoader().getResourceAsStream("pay.properties");
			pps.load(in);

			IP = pps.getProperty("IP");
			port = pps.getProperty("port");
			prefix = "http://" + IP + ":" + port;
			key = pps.getProperty("APP_KEY");
			appId = pps.getProperty("APPID");
			mch_id = pps.getProperty("MCH_ID");
			secret = pps.getProperty("AppSecret");
			weixin_pay_callback_url = pps.getProperty("weixin_pay_callback_url");
			weixin_tec_pay_callback_url = pps.getProperty("weixin_tec_pay_callback_url");


			weixin_refund_callback_url = pps.getProperty("weixin_refund_callback_url");


			log.info("参数 : key--> " + key + " appId--> " + appId
					+ " mch_id--> " + mch_id + "  secret--> " + secret
					+ "  weixin_callback_url --> " + weixin_pay_callback_url);

		}catch (Exception e){

		}



	}

}
